//
//  DetailsCell.m
//  Otaku
//
//  Created by lanou3g on 16/5/9.
//  Copyright © 2016年 Liuwx. All rights reserved.
//

#import "DetailsCell.h"

@interface DetailsCell ()
//评论者头像
@property (weak, nonatomic) IBOutlet UIImageView *headPortraitImageLabel;
//评论者昵称
@property (weak, nonatomic) IBOutlet UILabel *nicknamelLabel;
//评论者赞
@property (weak, nonatomic) IBOutlet UILabel *praiseLabel;
//评论者时间
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
//评论内容
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;


@end

@implementation DetailsCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)layoutSubviews {
    self.headPortraitImageLabel.layer.cornerRadius = 15;
    self.headPortraitImageLabel.layer.masksToBounds = YES;
    
    [self.headPortraitImageLabel sd_setImageWithURL:[NSURL URLWithString:self.model.avatar_url]];
    self.nicknamelLabel.text = self.model.user_name;
    self.praiseLabel.text = [NSString stringWithFormat:@"%ld",self.model.digg_count];
    NSString *time = [NSString stringWithFormat:@"%ld",self.model.create_time];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle ];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"MM-dd HH:mm"];
    NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:(NSTimeInterval)[time intValue]];
    NSString *confromTimespStr = [formatter stringFromDate:confromTimesp];
    self.timeLabel.text = [NSString stringWithFormat:@"%@",confromTimespStr];
    self.contentLabel.text = self.model.text;
    
    
    
}

- (void)updateToDaySkinMode {
    self.backgroundColor = [UIColor whiteColor];
    
}

- (void)updateToNightSkinMode {
    self.backgroundColor = [UIColor blackColor];
    
}

//赞
- (IBAction)didClickpraiseBut:(UIButton *)sender {
}
@end
